<?php echo $this->Html->script('combos') ?>
<?php echo $this->Html->css('order') ?>


<div class="drivers form">
    <?php echo $this->Form->create('Driver'); ?>
    <fieldset>
        <legend><?php echo __('Nuevo Chofer'); ?></legend>

        <?php echo $this->element('drivers/fields') ?>
    </fieldset>
    <?php echo $this->Form->end(__('Guardar')); ?>
</div>
<div class="actions">
    <h3><?php echo __('Opciones'); ?></h3>
    <ul>
        <li><?php echo $this->Html->link(__('Choferes'), array('action' => 'index')); ?></li>
        <li><?php echo $this->Html->link(__('Empresas'), array('controller' => 'companies', 'action' => 'index')); ?> </li>
        <li><?php // echo $this->Html->link(__('Crear Orden de Ruta'), array('controller' => 'orders', 'action' => 'add'));   ?> </li>
    </ul>
</div>
<script>
    $(document).ready(function() {
        
        $("#DriverCompanyId").change(function() {

            $("#DriverVehicleId").load('<? echo $this->Html->url('../Vehicles/selectChange') ?>',{idCompany:$("#DriverCompanyId").val()});
            $("#DriverCoupledId").load('<? echo $this->Html->url('../Coupleds/selectChange') ?>',{idCompany:$("#DriverCompanyId").val()});
            $("#DriverVehicleId").removeAttr('disabled');
            $("#DriverCoupledId").removeAttr('disabled');


        });
            
    })
</script>